package com.zhyz.bookstore.entity;

import java.util.Date;

public class CartItem {
    //购物车中单个商品
    private String id;//此项id
    private User userinfo;//用户信息
    private Book book;//书信息
    private int quantity;//数量
    private double price;//价格
    private Date time;//时间
    private double money;// 本项小计

    public String getId() {
        return id;
    }
    public CartItem(Book book) {
        this.book = book;
    }
    public void setId(String id) {
        this.id = id;
    }

    public User getUserinfo() {
        return userinfo;
    }

    public void setUserinfo(User userinfo) {
        this.userinfo = userinfo;
    }

    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public double getMoney() {
        return book.getBookPrice() * quantity;
    }

    public void setMoney(float money) {
        this.money = money;
    }

    @Override
    public String toString() {
        return super.toString();
    }
}
